<!-- $Id: order_info.htm 15544 2009-01-09 01:54:28Z zblikai $ -->

{include file="pageheader.htm"}
{insert_scripts files="topbar.js,../js/utils.js,listtable.js,selectzone.js,../js/common.js"}

<div class="list-div" style="margin-bottom: 5px">
<table width="100%" cellpadding="3" cellspacing="1">
  <tr>
    <th colspan="4">{$lang.base_info}</th>
  </tr>

  <tr>
    <td width="18%"><div align="right"><strong>{$lang.label_order_sn}</strong></div></td>
   <td width="34%">{$back_order.order_sn}{if $back_order.extension_code eq "group_buy"}<a href="group_buy.php?act=edit&id={$back_order.extension_id}">{$lang.group_buy}</a>{elseif $back_order.extension_code eq "exchange_goods"}<a href="exchange_goods.php?act=edit&id={$back_order.extension_id}">{$lang.exchange_goods}</a>{/if}
    <td><div align="right"><strong>{$lang.label_order_time}</strong></div></td>
    <td>{$base_order.add_time}</td>
  </tr>
  <tr>
    <td width="18%"><div align="right"><strong>服务类型：</strong></div></td>
   <td width="34%">
{if $back_order.back_type eq 1}退货{/if}
{if $back_order.back_type eq 2}换货{/if}
{if $back_order.back_type eq 3}维修{/if}
    {if $back_order.back_type eq 4}退款（无需退货）{/if}
   </td>
    <td><div align="right"><strong>退款方式：</strong></div></td>
    <td>
    	{if $back_order.back_pay eq 1}退款至账户余额{/if}
        {if $back_order.back_pay eq 2}原支付方式返回{/if}
    </td>
  </tr>
  <tr>
    <td><div align="right"><strong>{$lang.label_user_name}</strong></div></td>
    <td>{$back_order.user_name|default:$lang.anonymous}</td>
    <td><div align="right"><strong>{$lang.label_how_oos}</strong></div></td>
    <td>{$base_order.how_oos}</td>
  </tr>
  <tr>
    <td><div align="right"><strong>{$lang.label_shipping}</strong></div></td>
    <td>{if $base_order.shipping_id > 0}{$base_order.shipping_name}{/if} </td>
    <td><div align="right"><strong>{$lang.label_shipping_fee}</strong></div></td>
    <td>{$base_order.shipping_fee}</td>
  </tr>
  <tr>
    <td><div align="right"><strong>{$lang.label_insure_yn}</strong></div></td>
    <td>{if $base_order.insure_yn}{$lang.yes}{else}{$lang.no}{/if}</td>
    <td><div align="right"><strong>{$lang.label_insure_fee}</strong></div></td>
    <td>{$base_order.insure_fee|default:0.00}</td>
  </tr>
  <tr>
    <td><div align="right"><strong>{$lang.label_invoice_no}</strong></div></td>
    <td >{$base_order.invoice_no}</td>
	<td><div align="right"><strong>{$lang.label_shipping_time}</strong></div></td>
    <td>{$base_order.shipping_time}</td>
  </tr>
  </table>
</div>
<div class="list-div" style="margin-bottom: 5px">
<table width="100%" cellpadding="3" cellspacing="1">
  <tr>
    <th colspan="4">{$lang.back_info}</th>
    </tr>
  <tr>
    <td><div align="right"><strong>申请退货/维修时间：</strong></div></td>
    <td>{$back_order.formated_add_time}</td>
    <td><div align="right"><strong>申请人用户名：</strong></div></td>
    <td>{$back_order.user_name}</td>
  </tr>
  <tr>
    <td><div align="right"><strong>换回商品收件人：</strong></div></td>
    <td>{$back_order.consignee|escape}</td>
    <td><div align="right"><strong>联系电话：</strong></div></td>
    <td>{$base_order.tel}</td>
  </tr>
  <tr>
    <td><div align="right"><strong>换回商品收货人地址：</strong></div></td>
    <td >{$back_order.address|escape}</td>
	 <td><div align="right"><strong>邮编：</strong></div></td>
    <td>{$back_order.zipcode|escape}</td>
  </tr>
  <tr>
    <td><div align="right"><strong>退货/维修原因：</strong></div></td>
    <td colspan=3>{$back_order.back_reason}</td>
	</tr>
  <tr>
    <td><div align="right"><strong>用户退回商品所用快递：</strong></div></td>
    <td>{$back_order.shipping_name|escape}</td>
    <td><div align="right"><strong>运单号：</strong></div></td>
    <td>{$back_order.invoice_no}</td>
  </tr>
	<tr>
    <td><div align="right"><strong>图片：</strong></div></td>
    <td colspan=3>
    <!--{if ($imgs)}-->
    <!--{foreach from=$imgs item=src}-->
    <div style="float:left; padding:4px; border:solid #ddd 1px; margin:0 10px 10px 0"><a href="{$src}" target="_blank"><img height="100" src="{$src}" /></a></div>
    <!--{/foreach}-->
    <!--{/if}-->
    </td>
  </tr>
</table>
</div>
<div class="list-div" style="margin-bottom: 5px">
<table width="100%" cellpadding="3" cellspacing="1">
  <tr>
    <th colspan="2">客户留言</th>
  </tr>
  {if $back_order.postscript}
  <tr>
    <td width="18%"><div align="right">（{$back_order.formated_add_time}）<strong>客户：</strong></div></td>
    <td>{$back_order.postscript}</td>
  </tr>
  {/if}
  <!--{foreach from=$back_replay item=value}-->
  <tr>
    <td><div align="right">（{$value.add_time}）{if $value.type eq 0}<strong style="color:#F00">客服：</strong>{else}<strong>客户：</strong>{/if}</div></td>
    <td>{$value.message}</td>
  </tr>
  <!--{/foreach}-->
  
  <tr>
    <td width="18%"></td>
    <td>
    	<script>
		function check_replay()
		{
			if (document.getElementById("message").value == '')
			{
				alert("请输入回复内容！");
				document.getElementById("message").focus();
				return false;	
			}
		}
		</script>
    	<form action="back.php?act=replay" method="post" onsubmit="return check_replay()">
        <input name="back_id" type="hidden" value="{$smarty.request.back_id}">
    	<div><textarea id="message" name="message" style="width:500px; height:60px;"></textarea></div>
        <div><input type="submit" value="回复" /></div>
        </form>
    </td>
  </tr>
</table>
</div>



<div class="list-div" style="margin-bottom: 5px">

<table width="100%" cellpadding="3" cellspacing="1">
  <tr>
    <th colspan="7" scope="col">{$lang.goods_info}</th>
    </tr>
  <tr>
    <td scope="col"><div align="center"><strong>{$lang.goods_name_brand}</strong></div></td>
    <td scope="col"><div align="center"><strong>{$lang.goods_sn}</strong></div></td>
    <td scope="col"><div align="center"><strong>{$lang.product_sn}</strong></div></td>
    <td scope="col"><div align="center"><strong>{$lang.goods_attr}</strong></div></td>
    <td colspan=3><div align="center"><strong>{$lang.label_send_number}</strong></div></td>
  </tr>
 {foreach from=$order_goods item=goods_info}
 <tr>
 <td>{$goods_info.goods_name}</td>
 <td>{$goods_info.goods_id}</td>
 <td>{$goods_info.product_id}</td>
 <td>{$goods_info.goods_attr}</td>
 <td colspan=3>{$goods_info.send_number}</td>
 </tr>
 {/foreach}
  <tr>
    <th colspan="7" scope="col">{$lang.back_goods_info}</th>
    </tr>
  <tr>
    <td scope="col"><div align="center"><strong>{$lang.goods_name_brand}</strong></div></td>
    <td scope="col"><div align="center"><strong>{$lang.goods_sn}</strong></div></td>
    <td scope="col"><div align="center"><strong>{$lang.product_sn}</strong></div></td>
    <td scope="col"><div align="center"><strong>{$lang.goods_attr}</strong></div></td>
	<td scope="col"><div align="center"><strong>业务</strong></div></td>
	<td scope="col"><div align="center"><strong>应退金额</strong></div></td>
    <td scope="col" ><div align="center"><strong>{$lang.label_send_number}</strong></div></td>
  </tr>
  {foreach from=$goods_list item=goods}
  <tr>
    <td>
    {if $goods.goods_id gt 0 && $goods.extension_code neq 'package_buy'}
    <a href="../goods.php?id={$goods.goods_id}" target="_blank">{$goods.goods_name} {if $goods.brand_name}[ {$goods.brand_name} ]{/if}
    {/if}
    </td>
    <td><div align="left">{$goods.goods_id}</div></td>
    <td><div align="left">{$goods.product_id}</div></td>
    <td><div align="left">{$goods.goods_attr|nl2br}</div></td>
	<td>
	    {if $back_order.back_type eq 1}退货{/if}
	    {if $back_order.back_type eq 2}换货{/if}
	    {if $back_order.back_type eq 3}维修{/if}
	    {if $back_order.back_type eq 4}退款（无需退货）{/if}	
	</td>
	<td>{if $back_order.back_type eq 1}{$goods.back_goods_money}{/if}</td>
    <td><div align="left">{$goods.back_goods_number}</div></td>
  </tr>
  {/foreach}
  {if $back_order.back_type eq 4}
  <tr>
  <td colspan="7"><strong>此单为整单退款，订单已付金额（应退金额）：{$back_order.money_paid}</strong></td>
  </tr>
  {/if}
</table>
</div>

<div class="list-div" style="margin-bottom: 5px">
<form  action="back.php?act=operate" method="post">
<table cellpadding="3" cellspacing="1">
  <tr>
    <th colspan="6">{$lang.action_info}</th>
  </tr>
  <tr>
    <td><div align="right"><strong>{$lang.label_action_note}</strong></div></td>
  <td colspan="5"><textarea name="action_note" cols="80" rows="3"></textarea></td>
    </tr>
  <tr>
    <td><div align="right"></div>
      <div align="right"><strong>{$lang.label_operable_act}</strong> </div></td>
    <td colspan="5">
	{if $back_order.status_back lt 6}
		{if $back_order.status_back eq 5}
			{if $operable_list.ok}
			<input name="ok" type="submit" value="通过申请" class="button" />
			{/if}
			{if $operable_list.no}
			<input name="no" type="submit" value="拒绝申请" class="button" />
			{/if}
		{else}
			{if $operable_list.confirm && $back_order.back_type neq 4 && $back_order.status_back eq 0 && ($back_order.status_refund eq 0 || $back_order.status_refund eq 9)}
			<input name="confirm" type="submit" value="收到用户寄回商品" class="button" />
			{/if} 
			{if $operable_list.backshipping && $back_order.back_type neq 4 && $back_order.status_back eq 1 && ($back_order.status_refund eq 0 || $back_order.status_refund eq 9)}
			<!--<input name="backshipping" type="submit" class="button" value="换出商品寄出" />-->
			{/if}
			{if ($back_order.back_type eq 4 || ($back_order.back_type eq 1 && ($back_order.status_back eq 1 || $back_order.status_back eq 2))) && ($back_order.status_refund eq 0 || $back_order.status_refund eq 9)}
			<input name="refund" type="submit" value="去退款" class="button" />
			{/if}
			{if $operable_list.backshipping && $back_order.back_type eq 3 && $back_order.status_back eq 1}
	        <input name="backshipping" type="submit" class="button" value="换出商品寄出" />
	        {/if}

			{if $operable_list.backfinish && ($back_order.status_refund eq 1 || $back_order.status_back eq 2)}
			<input name="backfinish" type="submit" value="完成" class="button" />
			{/if} 
        {/if}
		<input name="after_service" type="submit" value="{$lang.op_after_service}" class="button" />       
        <input name="back_id" type="hidden" value="{$smarty.request.back_id}">
	{else}
		{if $back_order.status_back eq 6}
		此单已被管理员拒绝
		{/if}
		{if $back_order.status_back eq 7}
		此单已被系统取消
		{/if}
		{if $back_order.status_back eq 8}
		此单已被用户自行取消
		{/if}
	{/if}
	</td>
  </tr>
  <tr>
    <th>{$lang.action_user}</th>
    <th>{$lang.action_time}</th>
    <th>退换货状态</th>
    <th>退款状态</th>
    <th>{$lang.action_note}</th>
  </tr>
  {foreach from=$action_list item=action}
  <tr>
    <td><div align="center">{$action.action_user}</div></td>
    <td><div align="center">{$action.action_time}</div></td>
    <td><div align="center">
    {if $back_order.back_type eq 4}
    退款（无需退货）
    {else}
    {$action.status_back}
    {/if}
    </div></td>
    <td><div align="center">{$action.status_refund}</div></td>
    <td>{$action.action_note|nl2br}</td>
  </tr>
  {/foreach}
</table>
</form>
</div>


{literal}
<script language="JavaScript">
{/literal}
  var oldAgencyId = {$back_order.agency_id|default:0};
{literal}
  onload = function()
  {
    // 开始检查订单
    startCheckOrder();
  }

</script>
{/literal}

{include file="pagefooter.htm"}